#include <stdio.h>

int main() {
    double temperatureS, temperatureE;
    scanf("%lf%lf", &temperatureS, &temperatureE);
    double deltaTemperature = temperatureE - temperatureS;
    double liquidMass, liquidC;
    scanf("%lf%lf", &liquidMass, &liquidC);
    double containerMass, containerC;
    scanf("%lf%lf", &containerMass, &containerC);
    double liquidEnergy = deltaTemperature * liquidC * liquidMass;
    double containerEnergy = deltaTemperature * containerC * containerMass;
    double sumEnergy = liquidEnergy + containerEnergy;
    printf("%.2lfkJ,%.2lf%%,%.2lf%%", sumEnergy / 1000, containerEnergy / sumEnergy,
    liquidEnergy / sumEnergy);
    // 虽然题目描述是“百分比”，但其实就是占比的小数后面加上一个百分号。题目具有一定误导性
}